﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shared/Columns.Master" AutoEventWireup="true"
    CodeBehind="View.aspx.cs" Inherits="SharingCenter.Web.Mod.Events.ViewEvent" %>
    <%--<%@ OutputCache Duration="7200"  VaryByParam="id" %>--%>
    <%--shequ01website.rar--%>
<asp:Content ID="Content1" ContentPlaceHolderID="TitlePlaceHolder" runat="server">
    <asp:Literal runat="server" ID="ltrTitle" /> - 活动
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
   <style type="text/css">
       .contentarea{width:530px;overflow:auto;}
   .mlist .m-item
    {
        float:left;
        margin-right:.5em;
    }
    
    .infotable td.label{width:55px; text-align:justify;}
    .infotable td{border-bottom:1px dashed #ddd; height:25px;}
    .infotable tr.last td{border-bottom:none;}
    .infotable tr:hover td{background:#F5F6F7;}
   </style>

   <script type="text/javascript">
       var eventId = "<%=_item.EventId %>";
   </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
    <script src="View.js" type="text/javascript"></script>
    <div class="ctn-p-t"></div>
    <asp:FormView ID="FormView1" runat="server" DataKeyNames="EventId" DataSourceID="LinqDataSource1"
         CssClass="evttable">
        <ItemTemplate>
          <%--  <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>--%>
                    <h2 class="w5">
                        <img src="../../Content/images/icons/calendar_16.png" alt="" />
                        <asp:Literal ID="Label14" runat="server" Text='<%# Eval("Title") %>' />
                        <asp:Image runat="server" Visible='<%#Eval("IsHot") %>' AlternateText="热" ToolTip="热" ImageUrl="~/Content/images/icons/fire_on.png" />
                        <asp:Image runat="server" Visible='<%#Eval("IsRecommended") %>' AlternateText="精华" ToolTip="精华" ImageUrl="~/Content/images/icons/star_on.png" />
                    </h2>
                    <table cellpadding="0" cellspacing="0" class="tb-full infotable">
                            <tr>
                                <td class="label litetext">
                                    发起者:
                                </td>
                                <td class="value ctn-p-l">
                                    <cc:AvatarImage runat="server" UserId='<%#Eval("CreatorUserId") %>' AvatarType="Tiny" Width="16" />
                                    <cc:NickNameLink ID="NickNameLink1" runat="server" UserId='<%#Eval("CreatorUserId") %>' CurrentUserId='<%#SharingCenter.Web.WebProfile.Current.UserId %>' />
                                </td>
                            </tr>
                            </table>
                    <asp:Panel runat="server" ID="pnPrivacyControl">
                    <div class="ctn-p-b">
                        <table cellpadding="0" cellspacing="0" class="tb-full infotable">
                            <tr>
                                <td class="label litetext">
                                    活动主题:
                                </td>
                                <td class="value ctn-p-l">
                                    <asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="label litetext">
                                    活动时间:
                                </td>
                                <td class="value ctn-p-l">
                                    <asp:Label ID="Label1" runat="server" Text='<%# SharingCenter.Web.Classes.Utility.FriendlyDateTime(Eval("StartDate"), SharingCenter.Web.Classes.TimeDisplayEnum.HourMin, true) %>' />
                                    至
                                    <asp:Label ID="Label3" runat="server" Text='<%# SharingCenter.Web.Classes.Utility.FriendlyDateTime(Eval("EndDate"), SharingCenter.Web.Classes.TimeDisplayEnum.HourMin, true) %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="label litetext">
                                    报名截至:
                                </td>
                                <td class="value ctn-p-l">
                                    <asp:Label ID="Label2" runat="server" Text='<%# SharingCenter.Web.Classes.Utility.FriendlyDateTime(Eval("SignUpCloseDate"), SharingCenter.Web.Classes.TimeDisplayEnum.HourMin, true) %>' />
                                    <asp:Label ID="lblSignUpRemainingDays" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td class="label litetext">
                                    报名审核:
                                </td>
                                <td class="value ctn-p-l">
                                    <asp:Label ID="Label11" runat="server" Text='<%#Convert.ToBoolean(Eval("NeedApproval"))?"需要":"不需要" %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="label litetext">
                                    人数限制:
                                </td>
                                <td class="value ctn-p-l">
                                    <asp:Label ID="Label4" runat="server" Text='<%# ((int)Eval("MaxParticipants") > 0) ?  Eval("MaxParticipants", "{0}人") : "无限制" %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="label litetext">
                                    活动类型:
                                </td>
                                <td class="value ctn-p-l">
                                    <asp:Label ID="Label5" runat="server" Text='<%# Eval("Category") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="label litetext">
                                    活动地点:
                                </td>
                                <td class="valuel ctn-p-l">
                                    <asp:Label ID="Label6" runat="server" Text='<%# Eval("Place") %>' />
                                    <asp:Label ID="Label7" runat="server" Text='<%# Eval("Venue") %>' />
                                </td>
                            </tr>
                            <tr class="last">
                                <td class="label litetext">
                                    费用说明:
                                </td>
                                <td class="value  ctn-p-l">
                                    <asp:Label ID="Label9" runat="server" Text='<%# Eval("Fee")==""?"无":Eval("Fee") %>' />
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div class="ctn1">
                        <h2 class="w5">
                            <img src="../../Content/images/icons/contacts_16.png" alt="" />
                            联系方式</h2>
                        <table cellpadding="0" cellspacing="0" class="tb-auto">
                            <tr>
                                <td class="label">
                                    联系人:
                                </td>
                                <td class="value">
                                    <asp:Label ID="Label8" runat="server" Text='<%# Eval("ContactPerson") %>' />
                                </td>
                            </tr>
                           
                               <asp:PlaceHolder runat="server" Visible='<%#Eval("ContactPhone").ToString()!="" %>'>
                            <tr>
                                <td class="label">
                                    联系电话：
                                </td>
                                <td class="value">
                                    <asp:Label ID="Label12" runat="server" Text='<%# Eval("ContactPhone") %>' />
                                </td>
                            </tr>
                            </asp:PlaceHolder>
                            <asp:PlaceHolder runat="server" Visible='<%#Eval("ContactEmail").ToString()!="" %>'>
                            <tr>
                                <td class="label">
                                    E-mail：
                                </td>
                                <td class="value">
                                    <asp:Label ID="Label13" runat="server" Text='<%# Eval("ContactEmail") %>' />
                                </td>
                            </tr>
                           </asp:PlaceHolder>
                        </table>
                    </div>
                    <div class="ctn1">
                        <h2 class="w5">
                            <img src="../../Content/images/icons/clipboard_16.png" alt="" />
                            活动介绍</h2>
                        <div class="contentarea">
                            <asp:Literal ID="Literal1" runat="server" Text='<%#Eval("Description") %>'></asp:Literal>
                        </div>
                    </div>
                    <div class="ctn1" id="signupbox">
                        <h2 class="w5">
                        <span class="nss ns-edit"></span>
                        <span class="iconlabel">
                            活动报名</span></h2>
                        <asp:Panel ID="pnSignUp" runat="server" CssClass="signup textright">
                            <asp:MultiView ID="mvSignUp" runat="server" ActiveViewIndex="0" OnPreRender="mvSignUp_PreRender">
                                <asp:View ID="View1" runat="server">
                                <%if (_item.SignUpCloseDate > DateTime.Now)
                                  { %>
                                    <asp:LinkButton rel="signup" ID="btnSignUp" runat="server" Text="我要报名" CssClass="submitbutton"
                                        OnClick="SignUp" />
                                    <ajaxctrltool:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" TargetControlID="btnSignUp"
                                        ConfirmText="确定要参加此活动吗？">
                                    </ajaxctrltool:ConfirmButtonExtender>
                                    <%} %>
                                </asp:View>
                                <asp:View ID="View2" runat="server">
                                    <a class="button" href="Invite.aspx?id=<%=Request.QueryString["id"] %>">邀请朋友</a>
                                    <%--<asp:LinkButton ID="Button2" runat="server" Text="邀请朋友" CssClass="submitbutton" />--%>
                                    
                                    <a class="canceleventbutton button">取消报名</a>
                                </asp:View>
                            </asp:MultiView>
                        </asp:Panel>
                    </div>
                    <div class="ctn-p-b">
                        <myuc:MessageBox runat="server" MessageType="Generic" ID="MessageBox1" OnPreRender="MessageBox1_PreRender"  />
                    </div>
                    </asp:Panel>
               <%-- </ContentTemplate>
            </asp:UpdatePanel>--%>
            <myuc:MessageBox ID="msgPrivacy" runat="server" Visible="false" MessageType="Warning" Text="该活动隐私权限为 &quot;仅限好友查看&quot;。" />
            <asp:Panel runat="server" ID="pnCommentPrivacyControl">
            <div class="ctn1">
                <h2 class="w5">
                    活动留言板</h2>
                
                <myuc:CommentControl ID="CommentControl1" EditorWidth="100%" runat="server" ContextId='<%#Eval("EventId") %>' AppName="Event" ContextName="Detail" />
            </div>
            </asp:Panel>
        </ItemTemplate>
    </asp:FormView>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="SharingCenter.Web.Classes.scDataContext"
        TableName="Sc_Events" Where="EventId == @EventId &amp;&amp; AdminApproved == @AdminApproved"
        StoreOriginalValuesInViewState="false">
        <WhereParameters>
            <asp:QueryStringParameter DbType="Guid" Name="EventId" QueryStringField="id" />
            <asp:Parameter DefaultValue="true" Name="AdminApproved" Type="Boolean" />
        </WhereParameters>
    </asp:LinqDataSource>
</asp:Content>
<asp:Content ContentPlaceHolderID="RightSidebarContentPlaceHolder" runat="server">
<asp:ListView runat="server" ID="lvSidebar">
    <LayoutTemplate><div runat="server" id="itemPlaceholder" /></LayoutTemplate>
    <ItemTemplate>
    <div class="ctn2 normal">
        <asp:Panel runat="server" Visible='<%#Eval("EventSource").ToString() == "GroupEvent" %>'>
            &laquo;&nbsp;<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%#Eval("EventSourceId", "~/Mod/Groups/Events/?id={0}") %>'>返回圈子</asp:HyperLink>
        </asp:Panel>
        <div class="ctn-p-b">
            <h2 class="w7">
                活动成员
            </h2>
            <asp:ListView ID="lvParticipants" runat="server" InsertItemPosition="None" GroupItemCount="3">
                <LayoutTemplate>
                    <table cellspacing="0" cellpadding="0" class="tb-full" id="tb-parts">
                        <tr runat="server" id="groupPlaceholder" />
                    </table>
                </LayoutTemplate>
                <GroupTemplate>
                    <tr>
                        <td runat="server" id="itemPlaceholder" />
                    </tr>
                </GroupTemplate>
                <ItemTemplate>
                    <td align="left" style="width: 33%" valign="top">
                        <%--<myuc:ThumbAvatar ID="VisitorAvatar" runat="server" UserId='<%#Eval("UserId") %>' />--%>
                        <span class="avtb" os="true" ><span class="uid" title="<%#Eval("UserId") %>"></span></span>
                    </td>
                </ItemTemplate>
                <EmptyItemTemplate>
                    <td style="width: 33%">
                    </td>
                </EmptyItemTemplate>
                <EmptyDataTemplate>
                    <div class="litetext">目前没有人参加此活动。</div>
                </EmptyDataTemplate>
            </asp:ListView>
        </div>
        <div class="ctn-p-b">
            <h2 class="w7">
                <div class="fc">
                    <div class="left">关注的人</div>
                    <div class="textfar fw-n sz-s">
                        <%if (!this.isFavorite)
                          { %>
                        <a href="javascript:AddFavorite('<%=eventId %>')">关注活动</a>
                        <%}else{ %>
                        <a href="javascript:DeleteFavorite('<%=eventId %>')">取消关注</a>
                        <%} %>
                    </div>
                </div>
                </h2>
            <myuc:UserAvatarList runat="server" ID="ualFavoriteCollectors" OnLoad="ualFavoriteCollectors_Load"
             EmptyUserListMessage="目前没有人关注过此活动。" />
        </div>
    </div>
    </ItemTemplate>
</asp:ListView>
    
</asp:Content>
